package common.commands;

import common.AltaRicaModelManager;

import model.AltaRicaNode;

public class Print implements ICommand {

	@Override
	public String getName() {
		
		return "print";
	}

	@Override
	public String getSynopsis() {
		
		return "print <AltaRicaNode>";
	}

	@Override
	public CommandValue run(String arg) {

		AltaRicaNode node = AltaRicaModelManager.getCurrentModel().getNode(arg);
		if (node == null) {
			System.out.println("Unknown AltaRica node: " + arg);
            return CommandValue.KO;
        }
        
		System.out.println(node);
                
        return CommandValue.OK;
	}

	@Override
	public String help() {
		
		return "Prints a given AltaRica Node";
	}

}
